<%namespace name="admin_include" file="/admin/base/include.html" />
<%inherit file="/front/base/breadcrumbbase.html"/>

<%def name="breadcrumb()">
<li><a href="/products/list.html">折扣商品</a><span class="divider">></span></li>
<li><a href="/products/category${product.category.id}/list.html">${product.category.name}</a><span class="divider">></span></li>
<li>${product.name}</li>
</%def>


<%def name="center()">
<%!
import datetime
%>
<style>
.coupondetail p{
    margin: 0 0;
}
</style>
<div class="row">
    <div class="page-header" style="margin:10px 0 15px;">
        <h3 class="no-margin">
            <a href="">${product.name}</a>
        </h3>
    </div>
</div><!--coupons-->
<div class="row">  
    %if request.session.peek_flash():
    <div class="alert alert-error">${request.session.pop_flash()[0]}</div>
    %endif
    <ul class="thumbnails">
        <li class="span3">
            <img src="${product.picture}" class="img-polaroid"/>
        </li>
        <li class="span6">
            <p class="no-margin"><span class="label label-info">市场价:</span> <span><del>￥${product.marketprice}</del></span></p>
            <p class="no-margin"><span class="label label-info">爱帮价:</span> <span class="badge badge-success" style="font-size:16px;">${product.sellprice}</span></p>
            <p class="no-margin"><span class="label label-info">付&nbsp;&nbsp;&nbsp;&nbsp;款:</span> <span>货到付款</span></p>
            <p class="no-margin"><span class="label label-info">配&nbsp;&nbsp;&nbsp;&nbsp;送:</span>&nbsp;<code>山大(威海)校内，免费送货上门</code><br/>
            <div class="coupondetail">
            ${h.entertobr(product.shortdetail)|n}
            </div>
            <br/>
            <div class="well">
                <p class="pull-left" style="width:70px;">购买数量:</p><p id="numberinput" class="pull-left"></p>
                <p style="margin-left:150px;"><a type="button" class="btn btn-success" id="shoppingcart" href="#">加入购物车</a></p>
            </div>
        </li>
    </ul>
</div><!--product-->
<div class="row">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#tab_business" data-toggle="tab">商品介绍</a></li>
        <!--<li><a href="#tab_contact" data-toggle="tab">用户评论</a></li>-->
    </ul>
    <div class="tab-content">
        <div class="tab-pane active" id="tab_business">
            ${product.detail|n}
        </div>
        <!--
        <div class="tab-pane" id="tab_contact">
            <p>tab2</p>
        </div>
        -->
    </div>
</div><!--business-->
</%def>

<%def name="script()">
${admin_include.jqxnumber()}
<script type="text/javascript">
    $(document).ready(function(){
        //set the number input
        var theme = getTheme();
        $('#numberinput').jqxNumberInput({width:'50px',height:'25px',inputMode:'simple',spinButtons:true,decimalDigits:0,min:1,theme:theme});
        $('#numberinput').jqxNumberInput('inputValue','1');
        $('#shoppingcart').click(function(){
            var buynumber = $('#numberinput').jqxNumberInput('val');
            window.location = '/products/shoppingcart/${product.id}.html?number='+buynumber+'&from=${request.url}';
        })
    })
</script>
</%def>
